package com.ruoyi.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.Domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;


@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_cash_history")
@ApiModel(value = "CashHistory对象", description = "佣金记录")
public class CashHistory extends Domain {
    @TableId(value = "id", type = IdType.AUTO)//如果没有这句 id会以很大的id
    @ApiModelProperty(name = "id", value = "主键-ID")
    private Long id;
    @Excel(name = "订单号", width = 30)
    @ApiModelProperty(value = "订单号")
    private String orderNo;
    @Excel(name = "商户订单号", width = 30)
    private String merchantOrderNo;
    @ApiModelProperty(value = "用户id")
    private Long userId;
    @Excel(name = "变动金额", width = 10)
    @ApiModelProperty(value = "变动金额")
    private BigDecimal changeMoney;
    @ApiModelProperty(value = "add 加  reduce 减")
    @Excel(name = "变化类型", readConverterExp = "add=金额增加,reduce=金额减少")
    private String changeType;



    @Excel(name = "余额", width = 10)
    @ApiModelProperty(value = "余额")
    private BigDecimal earning;
    @ApiModelProperty(value = "金粒 point  金额 money   积分  score")
    private String type;


    @ApiModelProperty(value = "渠道  admin 管理员修改  user app渠道")

    private String source  ;
    public CashHistory() {

    }

    public CashHistory(Long userId, BigDecimal changeMoney, String changeType, String remark, String type) {
        this.userId = userId;
        this.changeMoney = changeMoney;
        this.changeType = changeType;
        this.setRemark(remark);
        this.type = type;
    }

}